﻿using Coomtools.commclass;
using Sunny.UI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace CYLScheck.UIcomm
{
   /// <summary>
   /// 把关闭主窗口的委托传递到打开一个注册窗体中去
   /// </summary>
    public partial class AboutFrm : UIPage
    {  private Declosedmainform declosemain;
        public AboutFrm( Declosedmainform declMain)
        {
            InitializeComponent();
            declosemain = declMain;
        }


        private void AboutFromcs_Load(object sender, EventArgs e)
        {
            this.Style = Gobleset.Gobel_userstyle;
       


           
            if (Gobleset.Gobel_IsRegUser=="YES")


            {
                uiLabelUser.Text = "当前用户状态：" + Gobleset.Gobel_reguserid + " 已经授权";
                uiButton1.Text = "已注册";
                uiButton1.Enabled = false;

            }
           else
                uiLabelUser.Text = "当前用户状态：" + Gobleset.Gobel_reguserid + " 未授权";
       

        }

        private void AboutFromcs_Initialize(object sender, EventArgs e)
        {

        }

        private void uiButton1_Click(object sender, EventArgs e)
        {
            RegFrm regfrm = new RegFrm(declosemain);
            regfrm.ShowDialog();
        

            


        }

        private void uiPanel1_Load(object sender, EventArgs e)
        {
            /***************调用sunnyui 的showwaitform 和hidewaitfrom  实现等待界面

*****************************/





            GetHarewareInfo GetHardwareinf = new GetHarewareInfo();
            ShowWaitForm("系统正在收集计算机信息中,请等待........");
            if (GetHardwareinf.Gegharwareinfo() == false)
            {
                ShowErrorNotifier("获取硬件信息失败！");

            }
            infotouilable();
            HideWaitForm();
        }

       private void gethardinfo_thread()
        {
            GetHarewareInfo GetHardwareinf = new GetHarewareInfo();
            
          
            if (GetHardwareinf.Gegharwareinfo() == false)
            {
                ShowErrorNotifier("获取硬件信息失败！");

            }
          
            
           
        }
        private void infotouilable()
        {
           

                uiSlable_computername.AutoSize = true;
                uiSlable_CPUID.AutoSize = true;
                uiSlable_DIskNo.AutoSize = true;
                uiSlable_memory.AutoSize = true;
                uiSlable_MacAdress.AutoSize = true;
                uiSlable_Sysinfo.AutoSize = true;
                uiSlable_IPAdress.AutoSize = true;

                uiSlable_CPUID.Text = uiSlable_CPUID.Text + GobleSysInfo.CPUID;

                uiSlable_computername.Text = uiSlable_computername.Text + GobleSysInfo.ComputeName;
                uiSlable_DIskNo.Text = uiSlable_DIskNo.Text + GobleSysInfo.DiskHardNumber;
                // uiSlable_DIskNo.Text = uiSlable_DIskNo.Text + hardwareinfo.GetDiskID(); 
                uiSlable_memory.Text = uiSlable_memory.Text + GobleSysInfo.PPhysicalMemory;
                uiSlable_MacAdress.Text = uiSlable_MacAdress.Text + GobleSysInfo.MacAdress;
                uiSlable_Sysinfo.Text = uiSlable_Sysinfo.Text + GobleSysInfo.SysType;
                uiSlable_IPAdress.Text = uiSlable_IPAdress.Text + GobleSysInfo.IPAdress;





         
          
         }
        private void AboutFrm_Shown(object sender, EventArgs e)
        {

       





            //////////////////////////////////////////////////////////////////////////////








        }

        private void uiPanel1_Click(object sender, EventArgs e)
        {

        }

        private void uiLine2_Click(object sender, EventArgs e)
        {

        }
    }
}
